package test;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import expression.InfixtoPostfixTranslator;

public class JonathanDiDonatoIPTest {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testOne() {
		assertEquals("10 2 3 7 2 * ^ / 24 * + 86 - 9 +", InfixtoPostfixTranslator.eval("10 + 2 / 3 ^ ( 7 * 2 ) * 24 - 86 + 9"));
		assertEquals("5 3 + 4 6 19 - * - 3 - 1 7 / +", InfixtoPostfixTranslator.eval("5 + 3 - 4 * ( 6 - 19 ) - 3 + 1 / 7"));
		assertEquals("7 40 - 4 8 * 9 / + 2 6 ^ +", InfixtoPostfixTranslator.eval("7 - 40 + ( 4 * 8 ) / 9 + 2 ^ 6"));
		assertEquals("1 2 / 3 * 16 2 - 12 ^ + 4 -", InfixtoPostfixTranslator.eval("( 1 / 2 ) * 3 + ( 16 - 2 ) ^ 12 - 4"));
		assertEquals("6 8 2 + ^ 576 / 7 2 ^ 3 - 9 * -", InfixtoPostfixTranslator.eval("6 ^ ( 8 + 2 ) / 576 - ( 7 ^ 2 - 3 ) * 9"));
	}

}
